import { Camera } from "./camera.js";
import { mat4 } from '../gl-matrix/index.js';

export class OrthogonalCamera extends Camera {
    constructor(left, right, bottom, top, near, far) {
        super();

        this.left = left;
        this.right = right;
        this.bottom = bottom;
        this.top = top;
        this.near = near;
        this.far = far;

        this.updateProjectionMatrix();
    }

    updateProjectionMatrix() {
        mat4.ortho(this._projectionMatrix, this.left, this.right, this.bottom, this.top, this.near, this.far);
        mat4.invert(this._projectionMatrixInverse, this._projectionMatrix);
    }
}